﻿@{
    var faKitId = Display.GetThemeVariable("fa-kit-id");
    var faUsePro = Display.GetThemeVariable<bool>("fa-use-pro") && faKitId.HasValue();
}

@if (!faUsePro)
{
    @* Preload web font files to avoid FOIT (Flash of Invisible Text) and FOUT (Flash of Unstyled Text) *@
    <link as="font" rel="preload" href="~/lib/fa7/webfonts/fa-solid-900.woff2" crossorigin />
    <link as="font" rel="preload" href="~/lib/fa7/webfonts/fa-regular-400.woff2" crossorigin />

    <environment include="Development">
        <link rel="stylesheet" href="~/lib/fa7/css/all.css" crossorigin />
    </environment>
    <environment exclude="Development">
        <link rel="stylesheet" href="~/lib/fa7/css/all.min.css" crossorigin />
    </environment>
}
else
{
    @* Preconnect FA host *@
    <link rel="preconnect" href="https://kit.fontawesome.com" />

    @* Load custom FA Pro Kit *@
    <link rel="stylesheet" href="https://kit.fontawesome.com/@(faKitId).css" crossorigin="anonymous" />
}